<?php
class LloginAction extends LbaseAction {

	function index(){
		$sdate = $_GET['sdate'];
		$type  = $_GET['type'];
		$arrPram = range(1,4);
		if(!empty($sdate) && in_array($type,$arrPram)){
			$res = array();
			$caption= "";
			$xName = "";
			$showFiledName = $showHoverText = $showFiledvalue ="";

			switch ($type) {
				case 1:
					$caption = "日每时玩家数量统计";$xName = "时";
					$showFiledName = $showHoverText = "shour";$showFiledvalue="num";
					import("@.Model.stats.LoginHourModel");
					$loginHour =new	LoginHourModel();
					$res = $loginHour->order('id')->field("shour,num")->where("sday = '$sdate'")->select();;
					break;
			}
			$strXML = "<graph caption='$caption' subcaption='' xAxisName='$xName' yAxisMinValue='1000' yAxisName='Player Count' decimalPrecision='0' formatNumberScale='0' numberPrefix='' showNames='1' showValues='0' showAlternateHGridColor='1' AlternateHGridColor='ff5904' divLineColor='ff5904' divLineAlpha='20' alternateHGridAlpha='5'>";
			if(!empty($res)){
				foreach ($res as $arr) {
					$strXML .= "<set name='" . $arr[$showFiledName] . "' value='" . $arr['num'] . "' hoverText='" . $arr[$showHoverText] . "'/>";
				}
			}
			$strXML .= "</graph>";
			$this->assign('strXML',$strXML);
		}

		$this->display();
	}
}
?>